<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>${appname}-<c:if test="${!empty sessionScope._local_node_session}">${sessionScope._local_node_session.nodeName}-</c:if>${si:ctname("NET_TYPE",sessionScope._netType)}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">

	$(function(){
		var type="${pipeType}";
		if(type=="2"){
			$("div[name='tlq']").css("display","");
			$("div[name='tlq'] :input").attr("datatype","require");
			
			$("div[name='ftp']").css("display","none");
			$("div[name='ftp'] :input").attr("datatype","");
			
			$("#divport").css("display","");
		}else if(type=="0"){
			$("div[name='tlq']").css("display","none");
			$("div[name='tlq'] :input").attr("datatype","");
			
			$("div[name='ftp']").css("display","");
			$("div[name='ftp'] :input").attr("datatype","require");
			
			$("#divport").css("display","");
		}else{
			$("div[name='tlq']").css("display","none");
			$("div[name='ftp']").css("display","none");
			$("#divport").css("display","none");
		}
		$('#inputForm input').tooltip();
		//表单验证
		$('#inputForm').checkForm();
		
	    $('#inputForm').ajaxForm({ 
	        url: _ctx + "/registry/update_node_pipeline.do", 
	        type: "post",
	        dataType:"json",
	        beforeSubmit: function(){
	        		$("#sbmBtn").attr("disabled","disabled");
	        },
	        clearForm: false,
	        resetForm: false,
	        success: function(resp){
	        	if(resp.status == '1' ){
	        		ui.msg(resp.msg, 1);
	        		ui.go(_ctx + '/registry/node_pipeline_list.do');
	        	}else{
	        		ui.msg(resp.msg, 0);
	        	}
	        	$("#sbmBtn").removeClass("disabled").attr("disabled",null);
	        },
	        error:function(resp){
	        	ui.msg('请求发送失败', 0);
	    		$("#sbmBtn").removeClass("disabled").attr("disabled",null);
	        }
	    });
	});
	
	
</script>
</head>
<body>
<%@ include file="/WEB-INF/view/common/topbar.jsp"%>
<c:set var="vo" value="${_data}"/>
<div class="main-container" id="main-container">
	<div class="main-container-inner">
		<%@ include file="/WEB-INF/view/common/sidebar.jsp"%>
		<div class="main-content">
		<div class="breadcrumbs" id="breadcrumbs">
				<ul class="breadcrumb">
					<li>
						<i class="icon-home home-icon"></i>
						<a href="#">首页</a>
					</li>
					<li>
						<a href="#">传输通道管理</a>
					</li>
					<li class="active">传输通道修改</li>
				</ul>
			</div>
			<div class="page-content">
				<div class="row">
					<div class="col-xs-12">
						<div class="widget-box">
							<div class="widget-header header-color-white">
								<div class="widget-toolbar no-border">
									<a class="btn btn-primary btn-xs" href="${ctx}/registry/node_pipeline_list.do"><i class="icon-arrow-left"></i> 返回&nbsp;&nbsp;</a>
								</div>
							</div>
							<div class="widget-body">
								<div class="widget-main">
									<form class="form-horizontal" role="form" id="inputForm" action=""  method="post" >
										  <div class="form-group">
											   <label class="col-sm-3 control-label no-padding-right" for="form-field-1">交换通道</label>
											   <div class="help-block col-xs-12 col-sm-reset inline">
											   		<span class="help-inline col-xs-12 col-sm-7">
														<span class="middle"> ${pipeTypeText }</span>
													</span>
												</div>
										</div>
										<div class="space-4"></div>
										 <div class="form-group" name="tlq" style="display: none;">
											<label class="col-sm-3 control-label no-padding-right" for="form-field-2">jndi地址*</label>
											<div class="col-sm-9">
												<input type="text" class="col-xs-10 col-sm-5" 
													      	 value="${jndiUrl }"  name="jndiUrl" id="jndiUrl"  datatype="require" 
															placeholder="请输入jndi地址" msg="请输入jndi地址" title="必填项,jndi地址"/>
											</div>
										</div>
										<div class="space-4"></div>
										 <div class="form-group" name="ftp" style="display: none;">
											<label class="col-sm-3 control-label no-padding-right" for="form-field-3">ip*</label>
											<div class="col-sm-9">
												<input type="text" class="col-xs-10 col-sm-5" 
													      	value="${ip }" name="ip" id="ip"  datatype="require" 
															placeholder="请输入ip" 	msg="请输入ip" title="必填项,ip"/>
											</div>
										</div>
										<div class="space-4"></div>
										  <div class="form-group" id="divport" style="display: none;">
										    <label class="col-sm-3 control-label no-padding-right" for="form-field-4">端口*</label>
										    <div class="col-sm-9">
										      <input type="text" class="col-xs-10 col-sm-5" 
										      	name="port"  id="port"  
										      	datatype="require" 
										      	 value="${port }"
												placeholder="请输入端口" 	 msg="请输入端口" title="必填项,端口"/>
										    </div>
										  </div>
										  
										  <div class="space-4"></div>
										  <div class="form-group" name="ftp" style="display: none;">
										    <label class="col-sm-3 control-label no-padding-right" for="form-field-5">根目录*</label>
										    <div class="col-sm-9">
										      <input type="text" class="col-xs-10 col-sm-5" 
										      	name="dir"  id="dir"  
										      	datatype="require" 
										      	 value="${dir }"
												placeholder="请输入根目录" 	 msg="请输入根目录" title="必填项,根目录"/>
										    </div>
										  </div>
										  
										  <div class="space-4"></div>
										  <div class="form-group" name="ftp" style="display: none;">
										    <label class="col-sm-3 control-label no-padding-right" for="form-field-6">管理员用户名*</label>
										    <div class="col-sm-9">
										      <input type="text" class="col-xs-10 col-sm-5" 
										      	name="username"  id="username"  
										      	datatype="require" 
										      	 value="${ username}"
												placeholder="请输入管理员用户名" 	 msg="请输入管理员用户名" title="必填项,管理员用户名"/>
										    </div>
										  </div>
										  
										  <div class="space-4"></div>
										  <div class="form-group" name="ftp" style="display: none;">
										    <label class="col-sm-3 control-label no-padding-right" for="form-field-7">管理员密码*</label>
										    <div class="col-sm-9">
										      <input type="password" class="col-xs-10 col-sm-5" 
										      	name="password"  id="password"  
										      	 value="${ password}"
										      	datatype="require" 
												placeholder="请输入密码" 	 msg="请输入密码" title="必填项,密码"/>
										    </div>
										  </div>
										  <div class="space-4"></div>
										  <div class="form-group" >
										    <label class="col-sm-3 control-label no-padding-right" for="form-field-8">备注</label>
										    <div class="col-sm-9">
										      <textarea class="col-sm-5" placeholder="请输入备注"  name="remark"  id="remark"  row="3"  title="备注">${vo.remark }</textarea> 
										    </div>
										  </div>
										  <hr>
										   <div class="clearfix form-group">
										 		<div class="col-md-offset-3 col-md-9">
										      	<button type="submit" class="btn btn-sm btn-info" id="sbmBtn"><i class="icon-ok bigger-110"></i>提交</button>
										    </div>
										  </div>
								</form>
							</div>
						</div>
					</div>
				</div>
			 </div>
		</div>
	</div>
</div>
</div>
</body>
</html>